﻿using HRMSystem.Models;
using HRMSystem.Wpf.BranchPages;
using HRMSystem.Wpf.CompanyPages;
using HRMSystem.Wpf.DepartmentPages;
using HRMSystem.Wpf.WpfWindow;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HRMSystem.Wpf.DepartmentPages
{
    /// <summary>
    /// Interaction logic for viewPage.xaml
    /// </summary>
    public partial class ViewPage : Page
    {
        private static ViewPage instance;
        List<DepartmentDetails> list;


        public ViewPage()
        {
            InitializeComponent();

            list = DBServices.DepartmentService.findDeparmentDetails();

            name.Text = list.ElementAt(0).NAME;

        }

        public static ViewPage Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new ViewPage();
                }

                return instance;
            }
        }


        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            DepartmentPage.Instance.ContentFrame.Content = EditPage.Instance; 

        }


        private void Add_Click(object sender, RoutedEventArgs e)
        {
         DepartmentPage.Instance.ContentFrame.Content = AddPage.Instance;

        }
        private void Company_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.Instance.ContentFrame.Content = CompanyPage.Instance;

        }
        private void Branch_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.Instance.ContentFrame.Content = BranchPage.Instance;
        }

        public static void NullInstance()
        {
            instance = new ViewPage();
        }

       
       

    }
}
